﻿using FluentNHibernate.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YYSite.Domain.BaseData;
using YYSite.Domain.BaseData.Grades;

namespace YYSite.Repository.BaseData.Grades
{

   public class GradeMap:ClassMap<Grade>
    {
        public GradeMap()
        {
            this.Table("Grade");
            this.Schema(BaseDataConstant.Schema);
            this.Id(p => p.Id);
            this.Map(p => p.GradeCode).Not.Nullable().UniqueKey("Grade_GradeCode_StudyYear_Semester");
            this.Map(p => p.StudyYear).Not.Nullable().UniqueKey("Grade_GradeCode_StudyYear_Semester");
            this.Map(p => p.Semester).Not.Nullable().UniqueKey("Grade_GradeCode_StudyYear_Semester");
            this.Map(p => p.GradeName);
            this.Map(p => p.CreateTime).Default("GETDATE()").Not.Nullable();
        }
    }
}
